package pers.lance.merchant.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pers.lance.merchant.dao.CustomerDao;
import pers.lance.merchant.pojo.Customer;

import java.util.List;

/**
 * @ Author     ：LILA3
 * @ Date       ：Created in 8:54 PM 7/30/2018
 */
@Service
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    CustomerDao customerDao;

    public CustomerServiceImpl() {
        System.out.println(CustomerServiceImpl.class.getName());
    }

    @Override
    @Transactional
    public Customer addCustomer(Customer customer) {
        return customerDao.insert(customer);
    }

    @Override
    public List<Customer> findAllCutomer() {
        return customerDao.finAll();
    }
}

